using System;

namespace SpeechRecognitionCSharp
{
    /// <summary>
    /// 音频读取器接口
    /// 定义音频文件读取的通用功能
    /// </summary>
    public interface IAudioReader
    {
        /// <summary>
        /// 音频采样率
        /// </summary>
        int SampleRate { get;  }

        /// <summary>
        /// 音频采样数据
        /// </summary>
        /// <remarks>采样数据已归一化到[-1, 1]范围</remarks>
        float[] Samples { get;  }

        /// <summary>
        /// 分块读取音频数据
        /// </summary>
        /// <param name="startIndex">起始索引</param>
        /// <param name="length">读取长度</param>
        /// <returns>音频数据块</returns>
        float[] ReadSamples(int startIndex, int length);
    }
}